class Result(object):
    def __init__(self, is_success=True, message="success", data=None, code=200):
        self.is_success = is_success
        self.message = message
        self.data = data
        self.code = code

    def get_dic_object(self):
        return self.__dict__

    @staticmethod
    def success_result(data=None, is_success=True, message="success", code=200):
        return Result(data=data, is_success=is_success, message=message, code=code)

    @staticmethod
    def error_result(data=None, message="failure", is_success=False, code=400):
        return Result(data=data, is_success=is_success, message=message, code=code)

    @staticmethod
    def get_result(data=None, message="", is_success=None):
        return Result(data=data, is_success=is_success, message=message)

    @property
    def success(self):
        return self.is_success
